<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/ugs/tenantUgsSuperLevelPrice.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<br>' +
            '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>会员管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>超级会员等级折扣设置</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">超级会员等级桩群折扣设置</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="frmSuperStationDiscount">
                        <input type="hidden" name="elecStationId" id="elecStationId"
                               value="${elecStation.elecStationId}">
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">桩群名：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"
                                       value="${elecStation.stationName}" readonly>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 control-label text-right">启用/禁用*：</label>
                            <div class="col-sm-8">
                                <label class="checkbox-inline col-sm-1">
                                    <input type="radio" name="status" value="0"
                                           <c:if test="${ugsLevelDiscountStationResultVo.status eq '0'}">checked</c:if>>启动</label>
                                <label class="checkbox-inline col-sm-1">
                                    <input type="radio" name="status" value="1"
                                           <c:if test="${ugsLevelDiscountStationResultVo.status eq '1'}">checked</c:if> >禁用</label>
                            </div>
                            <label class="col-sm-3 control-label text-right"></label>
                            <div class="col-sm-8">
                                <span class="help-block m-b-none"><font color="#ff8c00" size="1">选择启动,会员等级在该站点启动;</font></span>
                            </div>
                            <label class="col-sm-3 control-label text-right"></label>
                            <div class="col-sm-8">
                                <span class="help-block m-b-none"><font color="#ff8c00" size="1">选择禁止,会员等级在该站点禁止;</font></span>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">有效期*：</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="beginTime" id="beginTime"
                                       value="<fmt:formatDate value="${ugsLevelDiscountStationResultVo.beginTime}" pattern="yyyy-MM-dd HH:mm:ss" />"
                                       placeholder="请输入开始时间">
                            </div>
                            <label class="col-sm-0.5 col-form-label text-right">至</label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="endTime" id="endTime"
                                       value="<fmt:formatDate value="${ugsLevelDiscountStationResultVo.endTime}" pattern="yyyy-MM-dd HH:mm:ss" />"
                                       placeholder="请输入结束时间">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 control-label text-right">服务费折扣(0~1)*：</label>
                            <div class="col-sm-1">
                                <span class="help-block m-b-none">超级会员名称</span>
                            </div>
                            <label class="col-sm-0.5 col-form-label text-right"></label>
                            <div class="col-sm-2">
                                <span class="help-block m-b-none">服务费折扣值</span>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 control-label text-right"></label>
                            <div class="col-sm-1">
                                <span class="help-block m-b-none" style="line-height: 35px;">超级会员月卡*:</span>
                            </div>
                            <label class="col-sm-0.5 col-form-label text-right"></label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="v1" id="v1"
                                       value="${ugsLevelDiscountStationResultVo.v1}"
                                       placeholder="请输入服务费折扣值">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 control-label text-right"></label>
                            <div class="col-sm-1">
                                <span class="help-block m-b-none" style="line-height: 35px;">超级会员季卡*:</span>
                            </div>
                            <label class="col-sm-0.5 col-form-label text-right"></label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="v2" id="v2"
                                       value="${ugsLevelDiscountStationResultVo.v2}"
                                       placeholder="请输入服务费折扣值">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 control-label text-right"></label>
                            <div class="col-sm-1">
                                <span class="help-block m-b-none" style="line-height: 35px;">超级会员年卡*:</span>
                            </div>
                            <label class="col-sm-0.5 col-form-label text-right"></label>
                            <div class="col-sm-2">
                                <input type="text" class="form-control" name="v3" id="v3"
                                       value="${ugsLevelDiscountStationResultVo.v3}"
                                       placeholder="请输入服务费折扣值">
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-3 col-sm-offset-8 text-right">
                                <button type="submit" class="btn btn-success">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        var beginTime = laydate.render({
            elem: '#beginTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click',

            min: getNowFormatDate(),
            done: function (value, dates) {
                endTime.config.min = {
                    year: dates.year,
                    month: dates.month - 1, //关键
                    date: dates.date,
                    hours: 0,
                    minutes: 0,
                    seconds: 0
                };
            }
        });
        var endTime = laydate.render({
            elem: '#endTime',
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            trigger: 'click',

            min: getNowFormatDate()
        });

    });


    //获取当前的日期时间 格式“yyyy-MM-dd HH:MM:SS”
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + date.getHours() + seperator2 + date.getMinutes()
            + seperator2 + date.getSeconds();
        return currentdate;
    }

    editSuperStationDiscount.init();
</script>
</body>
</html>
